mudbox::Importer Class Reference

#include <importexport.h>

Inheritance diagram for mudbox::Importer:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class is the base class for plugins that import geometry into Mudbox.

To create a new importer plugin, derive your own class from this one and implement it. Use the DECLARE_CLASS and IMPLEMENT_CLASS macros to provide information about your importer to Mudbox. Once this is done, Mudbox will know enough about your class to use it. When the user wants to import a new file, mudbox will show the user a list of files filtered by the extension specified by your derived class, and if the user chooses one of those files, mudbox will instantiate your class and use it to import the file. When instantiated, the Importer will create it's own private scene. Override the Import() method to attach translated data items to the Importer's scene. Once the Import() call is complete, Mudbox will merge data from the importer's scene into the current scene.

At this time, meshes, materials and cameras are supported for import.


Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual  ~Importer ()
  Mudbox will destroy the importer after the import process is complete.
virtual QString  Extension (void)
  Returns the file extension read by this importer.
virtual QString  Description (void)
  Returns a small text description of your file type.
virtual void  Import (const QString &sFileName)
  Imports the data from the file and holds it locally.
virtual Scene SceneCreatedByImporter ()
  Returns the scene that was created by the importer.
void  AddMesh (Mesh *pMesh)
  Convenience method importers can use to add meshes to their imported scenes.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Protected Member Functions

  Importer ()
  Do not use the constructor directly.

Protected Attributes

aptr< Scene m_pScene
  Do not access this variable directly.

Constructor & Destructor Documentation

virtual mudbox::Importer::~Importer  )  [virtual]
 

Mudbox will destroy the importer after the import process is complete.

The importer's destructor will destroy the importer's private scene. Add your own destructor to cleanup any temporary data once the import is complete.

mudbox::Importer::Importer  )  [protected]
 

Do not use the constructor directly.

use CreateInstances instead.


Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::Importer::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::Node.

00044 : "ply".
const mudbox::ClassDesc* mudbox::Importer::StaticClass void   )  [static]
 

Reimplemented from mudbox::Node.

mudbox::Node* mudbox::Importer::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::Node.

virtual QString mudbox::Importer::Extension void   )  [virtual]
 

Returns the file extension read by this importer.

Override this function to make it return the extention of the file type you wish to read, for example: "ply". At this time only a single extension is supported.

virtual QString mudbox::Importer::Description void   )  [virtual]
 

Returns a small text description of your file type.

Override this function to make it return return a small description which will appear in the browse file dialog.

virtual void mudbox::Importer::Import const QString &  sFileName  )  [virtual]
 

Imports the data from the file and holds it locally.

This method will be called by Mudbox when it is time to import the data. Override this method to attach the loaded information to the importer's private scene that is returned by SceneCreatedByImporter(). It is probably easiest to store the data internally as Mesh objects.

virtual Scene* mudbox::Importer::SceneCreatedByImporter  )  [virtual]
 

Returns the scene that was created by the importer.

This function is called by Mudbox after Import(). Elements in this scene are merged into the Mudbox scene. Attach imported mesh data to this scene. The Importer class owns this Scene and is responsible for its memory. This always returns a non-null value.

void mudbox::Importer::AddMesh Mesh pMesh  ) 
 

Convenience method importers can use to add meshes to their imported scenes.

You can call this from your Import() method.


Member Data Documentation

aptr<Scene> mudbox::Importer::m_pScene [protected]
 

Do not access this variable directly.

use SceneCreatedByImporter() instead.


mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer
mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer mudbox::Importer